package top.yxqz.resp; /**
 * @author Mr.余
 * @date 2022/11/18
 * @package ${PACKAGE_NAME}
 * 刷新
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.net.URL;

@WebServlet(name = "RespDemo5", value = "/demo5")
public class RespDemo5 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setHeader("Refresh", "2;https://www.baidu.com/");
    }
}
